﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.Biz
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("fnd_object_security_tab", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class fnd_object_security : Entity<fnd_object_security>,Ifnd_object_security
    {
        #region 属性
 
        private String _pres_object;

        /// <summary>FLAGS=PMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^REF=FndPresObject^</summary>
        [DisplayName("Pres_Object")]
        [Description("FLAGS=PMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^REF=FndPresObject^")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn(1, "pres_object",  null, "varchar(50)", 0, 0, false)]

        public virtual String pres_object

        {
            get { return _pres_object; }
            set { if (OnPropertyChanging(__.pres_object, value)) { _pres_object = value; OnPropertyChanged(__.pres_object); } }
        }

 
        private String _sec_object;

        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
        [DisplayName("Sec_Object")]
        [Description("FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Sec Object^")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn(2, "sec_object",  null, "varchar(50)", 0, 0, false)]

        public virtual String sec_object

        {
            get { return _sec_object; }
            set { if (OnPropertyChanging(__.sec_object, value)) { _sec_object = value; OnPropertyChanged(__.sec_object); } }
        }

 
        private String _sec_object_type;

        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
        [DisplayName("Object_Type")]
        [Description("FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(3, "sec_object_type",  null, "varchar(50)", 0, 0, false)]

        public virtual String sec_object_type

        {
            get { return _sec_object_type; }
            set { if (OnPropertyChanging(__.sec_object_type, value)) { _sec_object_type = value; OnPropertyChanged(__.sec_object_type); } }
        }

 
        private String _sub_object_type;

        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
        [DisplayName("Object_Type1")]
        [Description("FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(4, "sub_object_type",  null, "varchar(50)", 0, 0, false)]

        public virtual String sub_object_type

        {
            get { return _sub_object_type; }
            set { if (OnPropertyChanging(__.sub_object_type, value)) { _sub_object_type = value; OnPropertyChanged(__.sub_object_type); } }
        }

 
        private String _info_type;

        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(20)^PROMPT=Info Type^</summary>
        [DisplayName("Type")]
        [Description("FLAGS=AMIUL^DATATYPE=STRING(20)^PROMPT=Info Type^")]
        [DataObjectField(false, false, false, 20)]
        [BindColumn(5, "info_type",  null, "varchar(20)", 0, 0, false)]

        public virtual String info_type

        {
            get { return _info_type; }
            set { if (OnPropertyChanging(__.info_type, value)) { _info_type = value; OnPropertyChanged(__.info_type); } }
        }

 
        private String _description;

        /// <summary></summary>
        [DisplayName("Description")]
        [Description("")]
        [DataObjectField(false, false, true, 255)]
        [BindColumn(6, "description",  null, "varchar(255)", 0, 0, false)]

        public virtual String description

        {
            get { return _description; }
            set { if (OnPropertyChanging(__.description, value)) { _description = value; OnPropertyChanged(__.description); } }
        }

 
        private String _force_read_only;

        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(5)^PROMPT=Force Read Only^</summary>
        [DisplayName("Read_Only")]
        [Description("FLAGS=AMIUL^DATATYPE=STRING(5)^PROMPT=Force Read Only^")]
        [DataObjectField(false, false, false, 5)]
        [BindColumn(7, "force_read_only",  null, "varchar(5)", 0, 0, false)]

        public virtual String force_read_only

        {
            get { return _force_read_only; }
            set { if (OnPropertyChanging(__.force_read_only, value)) { _force_read_only = value; OnPropertyChanged(__.force_read_only); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(8, "rowid",  null, "varchar(50)", 0, 0, false)]

        public virtual String rowid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }

 
        private String _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(9, "rowversion",  null, "varchar(24)", 0, 0, false)]

        public virtual String rowversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.pres_object : return _pres_object;
                    case __.sec_object : return _sec_object;
                    case __.sec_object_type : return _sec_object_type;
                    case __.sub_object_type : return _sub_object_type;
                    case __.info_type : return _info_type;
                    case __.description : return _description;
                    case __.force_read_only : return _force_read_only;
                    case __.objid : return _objid;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.pres_object : 
                        if(value != null)
                            _pres_object = Convert.ToString(value);
                        else
                            _pres_object = null;
                    break;
                    case __.sec_object : 
                        if(value != null)
                            _sec_object = Convert.ToString(value);
                        else
                            _sec_object = null;
                    break;
                    case __.sec_object_type : 
                        if(value != null)
                            _sec_object_type = Convert.ToString(value);
                        else
                            _sec_object_type = null;
                    break;
                    case __.sub_object_type : 
                        if(value != null)
                            _sub_object_type = Convert.ToString(value);
                        else
                            _sub_object_type = null;
                    break;
                    case __.info_type : 
                        if(value != null)
                            _info_type = Convert.ToString(value);
                        else
                            _info_type = null;
                    break;
                    case __.description : 
                        if(value != null)
                            _description = Convert.ToString(value);
                        else
                            _description = null;
                    break;
                    case __.force_read_only : 
                        if(value != null)
                            _force_read_only = Convert.ToString(value);
                        else
                            _force_read_only = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToString(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=PMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^REF=FndPresObject^</summary>
            public static readonly Field pres_object = FindByName(__.pres_object);

            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
            public static readonly Field sec_object = FindByName(__.sec_object);

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
            public static readonly Field sec_object_type = FindByName(__.sec_object_type);

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
            public static readonly Field sub_object_type = FindByName(__.sub_object_type);

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(20)^PROMPT=Info Type^</summary>
            public static readonly Field info_type = FindByName(__.info_type);

            ///<summary></summary>
            public static readonly Field description = FindByName(__.description);

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(5)^PROMPT=Force Read Only^</summary>
            public static readonly Field force_read_only = FindByName(__.force_read_only);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=PMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^REF=FndPresObject^</summary>
            public const String pres_object = "pres_object";

            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
            public const String sec_object = "sec_object";

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
            public const String sec_object_type = "sec_object_type";

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
            public const String sub_object_type = "sub_object_type";

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(20)^PROMPT=Info Type^</summary>
            public const String info_type = "info_type";

            ///<summary></summary>
            public const String description = "description";

            ///<summary>FLAGS=AMIUL^DATATYPE=STRING(5)^PROMPT=Force Read Only^</summary>
            public const String force_read_only = "force_read_only";

            ///<summary></summary>
            public const String objid = "objid";

            ///<summary></summary>
            public const String objversion = "objversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Ifnd_object_security
    {
       #region 属性
        /// <summary>FLAGS=PMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^REF=FndPresObject^</summary>

        String pres_object { get; set; }


        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>

        String sec_object { get; set; }


        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>

        String sec_object_type { get; set; }


        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>

        String sub_object_type { get; set; }


        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(20)^PROMPT=Info Type^</summary>

        String info_type { get; set; }


        /// <summary></summary>

        String description { get; set; }


        /// <summary>FLAGS=AMIUL^DATATYPE=STRING(5)^PROMPT=Force Read Only^</summary>

        String force_read_only { get; set; }


        /// <summary></summary>

        String rowid { get; set; }


        /// <summary></summary>

        String rowversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}